<div id="tb<?php echo $uniqid;?>" style="padding:5px">
	<table cellspacing="0" cellpadding="0">
		<tbody>
		<tr>
			<td><a href="javascript:void(0);" onclick="mergelogReload();" class="l-btn l-btn-small l-btn-plain"><span
					class="l-btn-left l-btn-icon-left"><i class="iconfont icon-shuaxin"></i><span class="l-btn-text">重载</span></span></a></td>
			<td><span style="line-height:30px;">日期</span>
				<input id="mergelogStartOn" style="width:110px" type="text"
					   class="easyui-datebox"> </input>至
				<input id="mergelogEndOn" style="width:110px" type="text"
					   class="easyui-datebox"> </input>
			</td>
			<td><select id="mergelogKeywordsType" class="forminput inputstyle textbox-text validatebox-text" style="width:120px">
					<option value="source_id">源账号会员ID</option>
					<option value="member_id">目标账号会员ID</option>
					<option value="nickname">目标账号会员昵称</option>
					<option value="phone">目标账号手机号</option>
			</select></td>
			<td>&nbsp&nbsp;<input id="mergelogKeywords" style="width:120px" type="text"
								  class="easyui-input textbox"></td>
			<td><a href="javascript:void(0);" onclick="mergelogSearch();" class="l-btn l-btn-small l-btn-plain"><span
					class="l-btn-left l-btn-icon-left"><i class="iconfont icon-sousuo"></i><span class="l-btn-text">查询</span></span></a></td>
		</tr>
		</tbody>
	</table>
</div>
<div class="con"  style="-moz-user-select:none;">
	<table id="mergelog"></table>
</div>
<div id="mergelogDlg" class="easyui-dialog" style="width:720px; height:520px;" title="信息框" closed="true"></div>
<script>
	var mergelogReload = function () {
		$("#mergelog").datagrid('reload');
	};
	var mergelogSearch = function () {
		var height = $(window).height() - $(".top").height() - 46;
		var width = $(window).width() - $(".leftmenu").width() - 8;
		$("#mergelog").datagrid({
			title: '会员账号合并记录',
			width: width,
			height: height,//高度
			singleSelect: true,//如果为true，则只允许选择一行
			striped: true,//是否显示斑马线效果。
			rownumbers: true,//如果为true，则显示一个行号列。
			pagination: true,//是否显示分页
			pageSize: 10,
			pageList: [10, 15, 20, 25],
			method: 'post',
			sortName: 'id',
			sortOrder: 'desc',
			idField: 'id',
			treeField: 'title',
			url: '/admin/member/mergelog',
			queryParams: {
				keywordsType: $('#mergelogKeywordsType').val(),
				keywords: $('#mergelogKeywords').val(),
				start_on: $('#tb<?php echo $uniqid;?> #mergelogStartOn').val(),
				end_on: $('#tb<?php echo $uniqid;?> #mergelogEndOn').val(),
			},
			fitColumns: true,//真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动。
			nowrap: true,//如果为true，则在同一行中显示数据。设置为true可以提高加载性能。 是否换行
			selectOnCheck: false,
			checkOnSelect: true,
			toolbar: '#tb<?php echo $uniqid;?>',
			columns: [[
				{field:'created_at',title:'时间',width:fixWidth(10)},
				{field: 'target_id', title: '目标账号ID', width: fixWidth(10)},
				{field: 'source_id', title: '源账号ID', width: fixWidth(10)},
				{
					field: 'target_name',
					title: '会员名称',
					width: fixWidth(10),
					formatter: function (value, rowData, rowIndex) {
						return rowData.target.realname ? rowData.target.realname : rowData.target.nickname;
					}
				},
				{
					field: 'target_phone',
					title: '会员电话',
					width: fixWidth(5),
					formatter: function (value, rowData, rowIndex) {
						return rowData.target.phone ? rowData.target.phone : '';
					}
				},
				{field:'remark',title:'备注',width:fixWidth(20)},
				{field:'oper_type',title:'操作人',width:fixWidth(5)},
				{field:'oper_id',title:'操作人ID',width:fixWidth(5),formatter(value){
						return value>0 ? value : '';
					}},
			]]
		});
	};
	onDatagridResize("#mergelog");
	mergelogSearch();
</script>
